<%@ page import="com.blog.pojo.Articles" %><%--
  Created by IntelliJ IDEA.
  User: honor
  Date: 2025/7/29
  Time: 22:08
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>${article.title}--文章修改</title>
    <link rel="icon" href="./favicon/favicon.ico" type="image/x-icon">
</head>
<body>
<h2>文章修改</h2>
<%
    Articles articles = (Articles) request.getAttribute("articles");
%>
<form action="articleServlet?method=update" method="post">
    <div class="mb-3">
        <label>ID</label>
        <input type="hidden" class="form-control" name="id" value="<%=articles.getId()%>" required readonly>
    </div>
    <div class="mb-3">
        <label>标题</label>
        <input type="text" class="form-control" name="title" value="<%=articles.getTitle()%>" required>
    </div>
    <div class="mb-3">
        <label>正文</label>
        <textarea class="form-control" name="content" rows="6" required><%=articles.getContent() != null ? articles.getContent() : ""%></textarea>
    </div>
    <div class="mb-3">
        <label>状态</label>
        <select class="form-select" name="status"  value="<%=articles.getStatus()%>">
            <option value="1">已发布</option>
            <option value="0">草稿</option>
        </select>
    </div>
    <button class="btn btn-success">保存</button>
</form>
</body>
</html>
